import React, {Component} from 'react'
import {Platform, StyleSheet, Text, View} from 'react-native'
import NavigationUtil from '../navigator/NavigationUtil.js'

type Props = {};
export default class StartUp extends Component<Props> {
  componentDidMount(){
    this.timer = setTimeout(() => {
      NavigationUtil.resetToHomePage({
        navigation: this.props.navigation
      })
      // NavigationUtil.resetToLoginPage({
      //   navigation: this.props.navigation
      // })
    }, 2000)
  }
  componentWillUnMount(){
    this.timer && clearTimeout(this.timer)
  }
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>Hi, Welcome, 欢迎页</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  welcome: {
    fontSize: 20,
    textAlign: 'center',
    margin: 10,
  },
});
